package 算法练习;

public class 位运算 {

    public static void main(String[] args) {
        String a = "100001";
        char[] arr = a.toCharArray();
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            count += (arr[i] & 1) == 1 ? 1 : 0;
        }
        System.out.println(count);
    }
}
